{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Musicians - Hard"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      " ········\n"
     ]
    }
   ],
   "source": [
    "import getpass\n",
    "import psycopg2\n",
    "from sqlalchemy import create_engine\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "pwd = getpass.getpass()\n",
    "engine = create_engine(\n",
    "    'postgresql+psycopg2://postgres:%s@192.168.31.31:15432/sqlzoo' % (pwd))\n",
    "pd.set_option('display.max_rows', 60)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "band = pd.read_sql_table('band', engine)\n",
    "composer = pd.read_sql_table('composer', engine)\n",
    "composition = pd.read_sql_table('composition', engine)\n",
    "concert = pd.read_sql_table('concert', engine)\n",
    "has_composed = pd.read_sql_table('has_composed', engine)\n",
    "musician = pd.read_sql_table('musician', engine)\n",
    "performance = pd.read_sql_table('performance', engine)\n",
    "performer = pd.read_sql_table('performer', engine)\n",
    "place = pd.read_sql_table('place', engine)\n",
    "plays_in = pd.read_sql_table('plays_in', engine)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 11.\n",
    "**List the name and town of birth of any performer born in the same city as James First.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>m_name</th>\n",
       "      <th>place_town</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Alan Fluff</td>\n",
       "      <td>London</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Andy Jones</td>\n",
       "      <td>London</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Theo Mengel</td>\n",
       "      <td>London</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        m_name place_town\n",
       "1   Alan Fluff     London\n",
       "2   Andy Jones     London\n",
       "0  Theo Mengel     London"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "jf = (musician.loc[musician['m_name']=='James First']\n",
    "      .merge(place, left_on='born_in', right_on='place_no')\n",
    "      [['born_in', 'place_town']])\n",
    "(musician.loc[musician['m_name'] != 'James First']\n",
    " .merge(jf, on='born_in')[['m_name', 'place_town']].sort_values('m_name'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 12.\n",
    "**Create a list showing for EVERY musician born in Britain the number of compositions and the number of instruments played.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>m_no</th>\n",
       "      <th>m_name</th>\n",
       "      <th>n_composition</th>\n",
       "      <th>n_instrument</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>14</td>\n",
       "      <td>Alan Fluff</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>19</td>\n",
       "      <td>Andy Jones</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>Davis Heavan</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>18</td>\n",
       "      <td>Elsie James</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>Fred Bloggs</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>17</td>\n",
       "      <td>Freda Miles</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>Harriet Smithson</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>Harry Forte</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>Helen Smyth</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>James First</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>16</td>\n",
       "      <td>James Quick</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>21</td>\n",
       "      <td>James Steeple</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>Jeff Dawn</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>John Smith</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20</td>\n",
       "      <td>Louise Simpson</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>13</td>\n",
       "      <td>Lovely Time</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>Phil Hot</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>Rose Spring</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>22</td>\n",
       "      <td>Steven Chaytors</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>Sue Little</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>Theo Mengel</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>15</td>\n",
       "      <td>Tony Smythe</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    m_no            m_name  n_composition  n_instrument\n",
       "13    14        Alan Fluff              0             2\n",
       "18    19        Andy Jones              1             0\n",
       "11    12      Davis Heavan              0             3\n",
       "17    18       Elsie James              0             3\n",
       "0      1       Fred Bloggs              2             0\n",
       "16    17       Freda Miles              2             0\n",
       "3      4  Harriet Smithson              0             2\n",
       "7      8       Harry Forte              2             3\n",
       "2      3       Helen Smyth              1             1\n",
       "4      5       James First              4             1\n",
       "15    16       James Quick              0             2\n",
       "20    21     James Steeple              0             0\n",
       "9     10         Jeff Dawn              1             2\n",
       "1      2        John Smith              0             3\n",
       "19    20    Louise Simpson              0             3\n",
       "12    13       Lovely Time              2             0\n",
       "8      9          Phil Hot              3             0\n",
       "10    11       Rose Spring              2             0\n",
       "21    22   Steven Chaytors              0             0\n",
       "6      7        Sue Little              2             1\n",
       "5      6       Theo Mengel              0             3\n",
       "14    15       Tony Smythe              1             0"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t = (musician.merge(place.loc[place['place_country'].isin(['England', 'Scotland'])],\n",
    "                    left_on='born_in', right_on='place_no', how='left')\n",
    "     .merge(composer, left_on='m_no', right_on='comp_is', how='left')\n",
    "     .merge(has_composed, left_on='comp_no', right_on='cmpr_no', how='left')\n",
    "     .merge(composition, left_on='cmpn_no', right_on='c_no', how='left')\n",
    "     .groupby(['m_no', 'm_name'])\n",
    "     .agg(n_composition=pd.NamedAgg(column='c_no', aggfunc='count'))\n",
    "     .reset_index())\n",
    "p = (musician.merge(performer, left_on='m_no', right_on='perf_is', how='left')\n",
    "     [['m_no', 'instrument']].drop_duplicates()\n",
    "     .groupby('m_no').agg(n_instrument=pd.NamedAgg(column='instrument', aggfunc='count'))\n",
    "     .reset_index())\n",
    "t.merge(p, on='m_no').sort_values('m_name')\n",
    "# t"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 13.\n",
    "**Give the band name, conductor and contact of the bands performing at the most recent concert in the Royal Albert Hall.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>band_name</th>\n",
       "      <th>contact</th>\n",
       "      <th>conductor</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Somebody Loves this</td>\n",
       "      <td>Theo Mengel</td>\n",
       "      <td>Alan Fluff</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             band_name      contact   conductor\n",
       "0  Somebody Loves this  Theo Mengel  Alan Fluff"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rah = (concert.loc[concert['concert_venue']=='Royal Albert Hall']\n",
    "       .sort_values('con_date', ascending=False).iloc[:1])\n",
    "(band.merge(musician.rename(columns={'m_name': 'contact'}), \n",
    "            left_on='band_contact', right_on='m_no')\n",
    " .merge(performance, left_on='band_no', right_on='gave')\n",
    " .merge(musician.rename(columns={'m_name': 'conductor'}),\n",
    "        left_on='conducted_by', right_on='m_no')\n",
    " .merge(rah, left_on='performed_in', right_on='concert_no')\n",
    " [['band_name', 'contact', 'conductor']])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 14.\n",
    "**Give a list of musicians associated with Glasgow. Include the name of the musician and the nature of the association - one or more of 'LIVES_IN', 'BORN_IN', 'PERFORMED_IN' AND 'IN_BAND_IN'.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>m_name</th>\n",
       "      <th>assoc</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Lovely Time</td>\n",
       "      <td>BORN_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Louise Simpson</td>\n",
       "      <td>BORN_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Steven Chaytors</td>\n",
       "      <td>BORN_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Harriet Smithson</td>\n",
       "      <td>LIVES_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Jeff Dawn</td>\n",
       "      <td>LIVES_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Andy Jones</td>\n",
       "      <td>LIVES_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Louise Simpson</td>\n",
       "      <td>LIVES_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>James Steeple</td>\n",
       "      <td>LIVES_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Jeff Dawn</td>\n",
       "      <td>IN_BAND_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Davis Heavan</td>\n",
       "      <td>IN_BAND_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Lovely Time</td>\n",
       "      <td>IN_BAND_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Alan Fluff</td>\n",
       "      <td>IN_BAND_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Tony Smythe</td>\n",
       "      <td>IN_BAND_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Elsie James</td>\n",
       "      <td>IN_BAND_IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Freda Miles</td>\n",
       "      <td>IN_BAND_IN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              m_name       assoc\n",
       "17       Lovely Time     BORN_IN\n",
       "18    Louise Simpson     BORN_IN\n",
       "19   Steven Chaytors     BORN_IN\n",
       "8   Harriet Smithson    LIVES_IN\n",
       "9          Jeff Dawn    LIVES_IN\n",
       "10        Andy Jones    LIVES_IN\n",
       "11    Louise Simpson    LIVES_IN\n",
       "12     James Steeple    LIVES_IN\n",
       "13         Jeff Dawn  IN_BAND_IN\n",
       "14      Davis Heavan  IN_BAND_IN\n",
       "15       Lovely Time  IN_BAND_IN\n",
       "16        Alan Fluff  IN_BAND_IN\n",
       "17       Tony Smythe  IN_BAND_IN\n",
       "18       Elsie James  IN_BAND_IN\n",
       "19       Freda Miles  IN_BAND_IN"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t1 = (musician.merge(place, left_on='born_in', right_on='place_no')\n",
    "      [['m_name', 'place_town']]\n",
    "      .assign(assoc='BORN_IN'))\n",
    "t2 = (musician.merge(place, left_on='living_in', right_on='place_no')\n",
    "      [['m_name', 'place_town']]\n",
    "      .assign(assoc='LIVES_IN'))\n",
    "t3 = (musician.merge(performer, left_on='m_no', right_on='perf_is')\n",
    "      .merge(plays_in, left_on='perf_no', right_on='player')\n",
    "      .merge(performance, left_on='band_id', right_on='gave')\n",
    "      .merge(concert, left_on='performed_in', right_on='concert_no')\n",
    "      .merge(place, left_on='concert_in', right_on='place_no')\n",
    "      [['m_name', 'place_town']]\n",
    "      .assign(assoc='PERFORMED_IN'))\n",
    "t4 = (musician.merge(plays_in, left_on='m_no', right_on='player')\n",
    "      .merge(band, left_on='band_id', right_on='band_no')\n",
    "      .merge(place, left_on='band_home', right_on='place_no')\n",
    "      [['m_name', 'place_town']]\n",
    "      .assign(assoc='IN_BAND_IN'))\n",
    "t = pd.concat([t1, t2, t3, t4])\n",
    "t.loc[t['place_town']=='Glasgow', ['m_name', 'assoc']].drop_duplicates()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 15.\n",
    "**Jeff Dawn plays in a band with someone who plays in a band with Sue Little. Who is it and what are the bands?**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>m_name</th>\n",
       "      <th>Sue's band</th>\n",
       "      <th>Jeff's band</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>John Smith</td>\n",
       "      <td>BBSO</td>\n",
       "      <td>AASO</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       m_name Sue's band Jeff's band\n",
       "0  John Smith       BBSO        AASO"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sue_band = (musician.loc[musician['m_name']=='Sue Little']\n",
    "            .merge(performer, left_on='m_no', right_on='perf_is')\n",
    "            .merge(plays_in, left_on='perf_no', right_on='player')\n",
    "            .merge(band, left_on='band_id', right_on='band_no')\n",
    "            [['band_id', 'band_name']])\n",
    "sue_coplayers = (musician\n",
    "                 .merge(performer, left_on='m_no', right_on='perf_is')\n",
    "                 .merge(plays_in, left_on='perf_no', right_on='player')\n",
    "                 .merge(sue_band, on='band_id'))\n",
    "jeff_band = (musician.loc[musician['m_name']=='Jeff Dawn']\n",
    "             .merge(performer, left_on='m_no', right_on='perf_is')\n",
    "             .merge(plays_in, left_on='perf_no', right_on='player')\n",
    "             .merge(band, left_on='band_id', right_on='band_no')\n",
    "             [['band_id', 'band_name']])\n",
    "jeff_coplayers = (musician\n",
    "                 .merge(performer, left_on='m_no', right_on='perf_is')\n",
    "                 .merge(plays_in, left_on='perf_no', right_on='player')\n",
    "                 .merge(jeff_band, on='band_id'))\n",
    "(sue_coplayers.merge(jeff_coplayers, on='m_no')\n",
    " [['m_name_x', 'band_name_x', 'band_name_y']]\n",
    " .rename(columns={'m_name_x': 'm_name', 'band_name_x': 'Sue\\'s band', \n",
    "                  'band_name_y': 'Jeff\\'s band'}))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
